<!--登录后主界面-->

<template>
  <el-container class="main_container ">
    <!--头部布局-->
    <el-header >
      <!--logo和项目名称-->
      <div class="left_box">
        <img src="../assets/img/lovely_3.webp">
        <span>心理健康早筛系统</span>
      </div>
      <!--用户登录展示的头像-->
      <div class="right_box">
        <el-dropdown @command="handleCommand">
          <img src="../assets/img/lovely_1.gif">
          <!--下拉菜单-->
          <el-dropdown-menu slot="dropdown">
           <!-- <el-dropdown-item  icon="el-icon-house" >个人中心</el-dropdown-item>-->
            <el-dropdown-item  icon="el-icon-switch-button" command="exit">退出登录</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </el-header>
    <el-container>
      <el-aside  width="200px">
        <el-menu
            class="el-menu-vertical-demo"
            background-color="#001529"
            text-color="#fff"
            active-text-color="#ffd04b"
            :router="true">
          <MenuTree  :menuList="this.menuList"></MenuTree>
        </el-menu>
      </el-aside>
      <el-main>
        <!--路由视图-->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import MenuTree from '@/components/MenuTree'
export default {
  name: 'Main',
  data(){
    return{
      menuList: [
        {
          "id": 1,
          "parentId": 0,
          "menuName": "首页",
          "url": "",
          "icon": "el-icon-s-custom",
          "orderNum": 1,
          "open": 0,
          "disabled": false,
          "perms": null,
          "type": 0,
          "children": [
            {
              "id": 11,
              "parentId": 1,
              "menuName": "个人中心",
              "url": "/self-centre",
              "icon": "el-icon-user-solid",
              "orderNum": 1,
              "open": 0,
              "disabled": false,
              "perms": null,
              "type": 0,
              "children": []
            }
          ]

        },
        {
          "id": 2,
          "parentId": 0,
          "menuName": "视频采集",
          "url": "/vedio",
          "icon": "el-icon-video-camera-solid",
          "orderNum": 2,
          "open": 0,
          "disabled": false,
          "perms": null,
          "type": 0,
          "children": []

        },
        {
          "id": 3,
          "parentId": 0,
          "menuName": "量表自测",
          "url": "/self-evaluation",
          "icon": "el-icon-edit-outline",
          "orderNum": 3,
          "open": 0,
          "disabled": false,
          "perms": null,
          "type": 0,
          "children": []

        },
        {
          "id": 4,
          "parentId": 0,
          "menuName": "互评测试",
          "url": "/namelist",
          "icon": "el-icon-document",
          "orderNum": 4,
          "open": 0,
          "disabled": false,
          "perms": null,
          "type": 0,
          "children": []

        },
        {
          "id": 5,
          "parentId": 0,
          "menuName": "消息通知",
          "url": "/message",
          "icon": "el-icon-message-solid",
          "orderNum": 5,
          "open": 0,
          "disabled": false,
          "perms": null,
          "type": 0,
          "children": []

        }
      ]
    }
  },
  methods:{
    handleCommand(exit) {
      this.$router.push('/login')
    }

  },
  components:{
    MenuTree
  }
}
</script>

<style  lang="less" scoped>
/*设置容器的高度*/
.main_container{
  height: 100%;
}

/*头部布局*/
.el-header {
  background-color: #001529;
  display: flex;
  justify-content: space-between;
  color: #FFFFFF;
  padding-left:0PX ;
  text-align: center;
  font-size: 20px;
  /*左边logo和标题*/
  .left_box{
    display: flex;
    align-items: center;
    /*logo*/
    img{
      width: 60px;
      height: 60px;
      margin: 0px 0px 10px 15px;
    }
    /*标题*/
    span{
      margin-left: 15px;
    }
  }
  /*右边登录头像*/
  .right_box{
    .el-dropdown>img{
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background-color: #FFFFFF;
      padding: 2px;
      margin: 0px 15px 0px 0px;
      background-size:contain;
    }
  }
}

/*侧边栏*/
.el-aside {
  background-color: #001529;

  .el-menu{
    border-right: none;
  }
}

/*内容主体*/
.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 20px;
}

/*下拉菜单的样式*/
.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
}

</style>
